import { useNavigate } from 'react-router-dom'
import { useMobile } from '@/hooks/useMobile'
import { usePageTitle } from '@/hooks'
import { addVisitCount } from '@/service/monitor'
import { useRequest } from 'ahooks'
import "./index.less"

export default function Home() {

  usePageTitle("")

  const navigate = useNavigate()
  
  const onStart = () => navigate("/blog")

  const { isMobile } = useMobile();

  useRequest(addVisitCount)

  return (
    <div className="home">
      {
        !isMobile && (
          <>
            <div className="gray">
              <div className="g1"></div>
            </div>
            <div className="blue">
              <div className="b1"></div>
            </div>
            <div className="green">
              <div className="g1"></div>
            </div>
          </>
        )
      }
      <div className="action">
        <button onClick={ onStart }>开始</button>
      </div>
    </div>
  )
}